<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
// Route::rule('路由表达式','路由地址','请求类型','路由参数（数组）','变量规则（数组）');





// 无参
Route::get('jywlkj','admin/login/login');
Route::get('adminIndex','admin/index/index');
Route::get('adminMain','admin/index/main');
Route::get('newsAdd','admin/index/newsAdd');
Route::get('newsAdmin','admin/index/newsAdmin');
Route::get('newsList','admin/index/tonewsAdmin');
Route::get('newsImage','admin/index/newsImage');
Route::get('gameImage','admin/index/gameImage');
Route::get('banner','admin/index/banner');
Route::get('game','admin/index/game');
Route::get('gonewsedit','admin/index/gonewsedit');
Route::get('gameedit','admin/index/gameedit');
Route::get('gameAdmin','admin/index/gameAdmin');
Route::get('gameEdit','admin/index/gameEdit');
Route::get('saleSql','admin/index/saleSql');
Route::get('weAdmin','admin/index/weAdmin');
Route::get('fweStatic','admin/index/fweStatic');
Route::get('tweStatic','admin/index/tweStatic');


// 必选参数
//Route::get('user/:id','index/index/user');

// 可选参数
Route::get('user/[:id]','index/index/user');

// 匹配参数
//Route::get('user/[:id]$','index/index/user');

//Route::get('blog/:year/:month','index/blog/year',['method'=>'get',['year'=>'\d{4}','mothod'=>'\d{2}']]);
//
//Route::get('userlist','admin/user/index',['ext'=>'html|shtml']);
//
//Route::get('blog/:id','index/blog/index',['method'=>'get'],['id'=>'\d+']);
//Route::get('blog/:name','index/blog/read',['method'=>'get'],['name'=>'\w+']);

// 分组
Route::group('blog',[
    ':year/:month'=>[
        'index/blog/year',
        ['method'=>'get'],
        ['year'=>'\d{4}', 'mothod'=>'\d{2}']
    ],
    ':id'=>[
        'index/blog/index',
        ['method'=>'get'],
        ['id'=>'\d+']
    ],
    ':name'=>[
        'index/blog/read',
        ['method'=>'get'],
        ['name'=>'\w+']
    ]
]);

Route::get('url','index/index/url');
Route::get('jump','admin/index/jump');
Route::get('rd','admin/index/rd');


Route::get('users/readpage/:id','rest/user/readpage');
// 资源路由
Route::resource('users','rest/user');
return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
